package cn.lzy.demo.okhttp;

import okhttp3.OkHttpClient;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description 判断静态工厂是否单例模式
 * @Author lzy
 * @Date 2023/12/5 17:30
 * @Version
 **/
public class TestDemoStatic {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
        OkHttpClient client1 = ctx.getBean("okHttpClientStaticFactory", OkHttpClient.class);
        OkHttpClient client2 = ctx.getBean("okHttpClientStaticFactory", OkHttpClient.class);
        System.out.println("client2 = " + client2);
        System.out.println(client1 == client2);
    }
}
